home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / st80_pr4.lha / st80_pre4 / MoDE / ModeEdit-Shan.st < prev    next >
Text File  |  1993-07-24  |  34KB  |  1,199 lines

  1. SemanticObject subclass: #ObjectDelegate
  2.     instanceVariableNames: 'clientObj links '
  3.     classVariableNames: 'ObjDelegateMiddleButtonMenu '
  4.     poolDictionaries: ''
  5.     category: 'ModeEdit-Shan'!
  6.  
  7.  
  8. !ObjectDelegate methodsFor: 'middleMenu support'!
  9.  
  10. edit
  11.     "Invoke a Smalltalk code editor.  Shan August 8, 1989"
  12.  
  13.     self eventQueue disable.
  14.     clientObj browse!
  15.  
  16. editHierarchy
  17.     "Invoke a Smalltalk code editor.  Shan August 22, 1989"
  18.  
  19.     self eventQueue disable.
  20.     BrowserView openCategoryBrowserOn: (self privateGetABrowser copy onClass: clientObj class) browseHierarchy!
  21.  
  22. hide
  23.     "Hide self and the links connected to self.  Shan August 12, 1989"
  24.  
  25.     mode eraseAndUnMap.
  26.     links do: [:each | each hide]!
  27.  
  28. inspectClient
  29.     "Shan August 12, 1989"
  30.  
  31.     self eventQueue disable.
  32.     clientObj inspect!
  33.  
  34. linkTo
  35.     "Create a link to an object.  Shan August 12, 1989"
  36.     "Arrange a inst var to save the pointer."
  37.  
  38.     | startPt endPt msgReceiverDel link instVarIndex existingLink |
  39.     (instVarIndex _ self arrangePtr) = nil ifTrue: ["The user aborted"
  40.         ^self].
  41.     startPt _ mode unclippedDisplayBox center.
  42.     endPt _ mode controller rubberLineOriginCltn: (OrderedCollection with: startPt)
  43.                 within: mode superView displayBox.
  44.     msgReceiverDel _ (mode topMode firstModeAt: endPt suchThat: [:each | "To avoid the semLinks get into the way.  Shan August 27, 1989"
  45.                 (each isKindOf: LineMode) not]) semanticObject.
  46.     "The msg 'theDelegate' is necessary because the first mode can be a  
  47.          SemObjDelPicture."
  48.     (msgReceiverDel isKindOf: ObjectDelegate)
  49.         | (msgReceiverDel isKindOf: SemObjDelPicture)
  50.         ifTrue: 
  51.             [msgReceiverDel _ msgReceiverDel theDelegate.
  52.             "Check if there has already a link"
  53.             existingLink _ links detect: [:each | (each theOtherEndOf: self)
  54.                             == msgReceiverDel]
  55.                         ifNone: [existingLink _ nil]]
  56.         ifFalse: ["Should only link to ObjectDelegate."
  57.             ^self].
  58.     "Set up the real msg link."
  59.     clientObj instVarAt: instVarIndex put: msgReceiverDel clientObject.
  60.     existingLink isNil
  61.         ifTrue: ["Put up the link."
  62.             Cursor wait
  63.                 showWhile: 
  64.                     [link _ MessageLink between: self and: msgReceiverDel.
  65.                     mode topMode addToBackSubMode: link mode.
  66.                     link mode display]]
  67.         ifFalse: [existingLink becomeBidirectional]!
  68.  
  69. makeSubclass
  70.     "This is hard.  Create a subclass and replace the old clientObj with  
  71.     an instance of the new subclass.    Shan August 16, 1989"
  72.  
  73.     | className |
  74.     self eventQueue disable.
  75.     className _ FillInTheBlank request: 'Name of the subclass?' initialAnswer: ''.
  76.     self eventQueue enable.
  77.     className = '' ifTrue: [^self].
  78.     "If new class, ask for super class"
  79.     Cursor wait
  80.         showWhile: 
  81.             [(Smalltalk classNames includes: className)
  82.                 ifFalse: ["Create the class"
  83.                     (Smalltalk at: clientObj class name asSymbol)
  84.                         subclass: className asSymbol
  85.                         instanceVariableNames: ''
  86.                         classVariableNames: ''
  87.                         poolDictionaries: ''
  88.                         category: 'Temporary-User'].
  89.             "Create a new instance of the clientObject and let it become  
  90.             self."
  91.             mode erase.
  92.             self replace: clientObj with: (Smalltalk at: className asSymbol) new.
  93.             "Update my appearnce"
  94.             self format.
  95.             mode display.
  96.             links do: [:each | each isShown
  97.                     ifTrue: 
  98.                         [each eraseLink.
  99.                         each updateLinkPosition.
  100.                         each show]]]!
  101.  
  102. privateGetABrowser
  103.     "Get any browser.  Shan August 22, 1989"
  104.  
  105.     | aBrowser topY bottomY metaY existingB topView |
  106.     existingB _ Browser allInstances.
  107.     existingB isEmpty
  108.         ifTrue: 
  109.             ["Need to create the first browser"
  110.             existingB add: (aBrowser _ Browser new on: SystemOrganization).
  111.             topY _ 0.35.
  112.             "change this to re-proportion system browser"
  113.             bottomY _ 1 - topY.
  114.             metaY _ 0.05.
  115.             "change this to re-proportion system browser"
  116.             (topView _ self
  117.                         model: aBrowser
  118.                         label: 'System Browser'
  119.                         minimumSize: 400 @ 250)
  120.                 addCategoryView: (0 @ 0 extent: 0.25 @ topY)
  121.                 on: aBrowser
  122.                 readOnly: false;
  123.                 addClassView: (0.25 @ 0 extent: 0.25 @ (topY - metaY))
  124.                 on: aBrowser
  125.                 readOnly: false;
  126.                 addMetaView: (0.25 @ (topY - metaY) extent: 0.25 @ metaY)
  127.                 on: aBrowser
  128.                 readOnly: false;
  129.                 addProtocolView: (0.5 @ 0 extent: 0.25 @ topY)
  130.                 on: aBrowser
  131.                 readOnly: false;
  132.                 addSelectorView: (0.75 @ 0 extent: 0.25 @ topY)
  133.                 on: aBrowser
  134.                 readOnly: false;
  135.                 addTextView: (0 @ topY extent: 1.0 @ bottomY)
  136.                 on: aBrowser
  137.                 initialSelection: nil.
  138.             topView icon: (Icon constantNamed: #default).
  139.             ^aBrowser].
  140.     ^existingB first!
  141.  
  142. showConnection
  143.     "Show all links connected to self.  Shan August 12, 1989"
  144.  
  145.     links do: 
  146.         [:each | 
  147.         each show.
  148.         each showTheOtherEndOf: self]! !
  149.  
  150. !ObjectDelegate methodsFor: 'menu access'!
  151.  
  152. middleButtonMenu
  153.     "Shan August 6, 1989"
  154.  
  155.     | logicMenu |
  156.     ObjDelegateMiddleButtonMenu isNil
  157.         ifTrue: 
  158.             [logicMenu _ MMSMenu new.
  159.             logicMenu append: (MenuCell selector: #showConnection text: 'Show Connection').
  160.             logicMenu append: (MenuCell selector: #linkTo text: 'Link To...').
  161.             logicMenu append: (MenuCell selector: #hide text: 'Hide').
  162.             logicMenu append: (MenuCell selector: #inspectClient text: 'Inspect').
  163.             logicMenu append: (MenuCell selector: #makeSubclass text: 'Subclass').
  164.             logicMenu append: (MenuCell selector: #edit text: 'Edit').
  165.             logicMenu append: (MenuCell selector: #editHierarchy text: 'Browse Hierarchy').
  166.             ObjDelegateMiddleButtonMenu _ MMSPopUpMenu createInterfaceFor: logicMenu].
  167.     ^ObjDelegateMiddleButtonMenu! !
  168.  
  169. !ObjectDelegate methodsFor: 'initialize-release'!
  170.  
  171. initialize
  172.     "Shan August 8, 1989"
  173.  
  174.     super initialize.
  175.     links _ OrderedCollection new! !
  176.  
  177. !ObjectDelegate methodsFor: 'private'!
  178.  
  179. arrangePtr
  180.     "This is a copy of the 'showVariableMenu:collect:' method of Behavior 
  181.      class.  Shan September 30, 1989"
  182.  
  183.     |  index  aStream lines count lastLine variables |
  184.     aStream _ WriteStream on: (String new: 200).
  185.     lines _ OrderedCollection new.
  186.     count _ 0.
  187.     lastLine _ 0.
  188.     variables _ OrderedCollection new.
  189.     clientObj class withAllSuperclasses
  190.         reverseDo: 
  191.             [:eachClass | 
  192.             count = lastLine
  193.                 ifFalse: 
  194.                     [lines add: count.
  195.                     lastLine _ count].
  196.             eachClass instVarNames do: 
  197.                 [:var | 
  198.                 aStream nextPutAll: (var contractTo: 20); cr.
  199.                 variables addLast: var.
  200.                 count _ count + 1]].
  201.     "Insert the Create Instance Varable option"
  202.     lines add: count.
  203.     count _ count + 1.
  204.     aStream nextPutAll: 'USE NEW Inst Var'; cr.
  205.     aStream skip: -1.
  206.     self eventQueue disable.
  207.     index _ (PopUpMenu labels: aStream contents lines: lines) startUp.
  208.     self eventQueue enable.
  209.     index = count ifTrue: [^self createNewInstVar].
  210.     index = 0
  211.         ifTrue: [^nil]
  212.         ifFalse: [^self checkVarUse: index]!
  213.  
  214. checkVarUse: index 
  215.     "If the var has been use, the screen may needs to be updated too.  
  216.     Return nil indicates that the user aborts.  Shan August 14, 1989"
  217.  
  218.     | choice |
  219.     (clientObj instVarAt: index) isNil
  220.         ifTrue: [^index]
  221.         ifFalse: 
  222.             ["The inst var has been used."
  223.             self eventQueue disable.
  224.             choice _ BinaryChoice message: 'This inst var has content.  Override?'.
  225.             self eventQueue enable.
  226.             choice
  227.                 ifTrue: 
  228.                     ["Erase whatever is necessary"
  229.                     self removePointerTo: (clientObj instVarAt: index).
  230.                     ^index]
  231.                 ifFalse: [^self createNewInstVar]]!
  232.  
  233. createNewInstVar
  234.     "Shan August 14, 1989"
  235.  
  236.     | name |
  237.     self eventQueue disable.
  238.     name _ FillInTheBlank request: 'Please enter the name of the new instance varable.'.
  239.     self eventQueue enable.
  240.     name = '' ifTrue: [^nil].
  241.     clientObj class addInstVarName: name.
  242.     ^clientObj class allInstVarNames indexOf: name!
  243.  
  244. format
  245.     "Shan August 17, 1989"
  246.  
  247.     | name |
  248.     name _ 'a' , clientObj class name asString.
  249.     mode displayObject clear.
  250.     mode displayObject relAdd: MMSOpaqueForm applModel.
  251.     mode displayObject relAdd: (name asDisplayText offset: 41@7).
  252.     mode resizeToFitDisplayObjectBy: 22@0!
  253.  
  254. removePointerTo: anObj 
  255.     "Message link is bi-directional.  Removing a ptr does not necessarily remove the link.  Shan September 14, 1989"
  256.  
  257.     | l |
  258.     l _ links detect: [:each | (each theOtherEndOf: self) clientObject
  259.                     == anObj] ifNone: [^self].
  260.     l notNil
  261.         ifTrue: 
  262.             [l removeLinkTo: (l theOtherEndOf: self)]! !
  263.  
  264. !ObjectDelegate methodsFor: 'controller-msg'!
  265.  
  266. move: e 
  267.     "Move the node with the links following it.  Shan September 30, 1989"
  268.  
  269.     |  pCltn  |
  270.     pCltn _ OrderedCollection new.
  271.     links do: [:each | each isShown
  272.             ifTrue: 
  273.                 [pCltn add: (each theOtherModeOf: mode) unclippedDisplayBox center.
  274.                 each eraseLink]].
  275.     mode controller moveImageWithin: nil linkTo: pCltn.
  276.     links do: [:each | each isShown
  277.             ifTrue: 
  278.                 [each updateLinkPosition.
  279.                 each show]]! !
  280.  
  281. !ObjectDelegate methodsFor: 'MMS-initializations'!
  282.  
  283. defaultMMSControllerClass
  284.     ^NetNodeController1!
  285.  
  286. setUpAppearance
  287.     "Shan August 6, 1989"
  288.  
  289.     mode borderWidth: 2.
  290.     mode insideColor: Form veryLightGray! !
  291.  
  292. !ObjectDelegate methodsFor: 'connection support'!
  293.  
  294. addLink: aLink
  295.     "Shan August 8, 1989"
  296.  
  297.     links add: aLink!
  298.  
  299. arrangeMessage
  300.     "Shan August 22,  1989"
  301.  
  302.     ^self arrangeMessageFrom: clientObj class!
  303.  
  304. arrangeMessageFrom: aClass 
  305.     "Start a dialogue to get the message that the user intends to send to 
  306.       my client. If the method not exists, create a stub.  Shan August 9,  
  307.      1989"
  308.  
  309.     | chosenSelector chosenIndex selectorCollection choice |
  310.     (selectorCollection _ aClass organization elements asSortedCollection) size = 0 ifTrue: ["Create a new method"
  311.         ^self createNewMsgSelector].
  312.     self eventQueue disable.
  313.     chosenIndex _ (PopUpMenu labelList: (Array
  314.                     with: selectorCollection
  315.                     with: #(NewMessage )
  316.                     with: #(MessageInSuperclass ))) startUp.
  317.     self eventQueue enable.
  318.     chosenIndex = (selectorCollection size + 1)
  319.         ifTrue: 
  320.             ["Create a new method"
  321.             self eventQueue disable.
  322.             choice _ BinaryChoice message: 'Create a new class?'.
  323.             choice
  324.                 ifTrue: [^self subclassNewMsg]
  325.                 ifFalse: [^self createNewMsgSelector]].
  326.     chosenIndex = (selectorCollection size + 2) ifTrue: ["List messages defined in superclass"
  327.         ^self arrangeMessageFrom: aClass superclass].
  328.     chosenSelector _ chosenIndex = 0 ifFalse: [selectorCollection at: chosenIndex].
  329.     ^chosenSelector!
  330.  
  331. clearConnectionsAndRemove
  332.     "Support the remove.  Lesson learned: do not change the contents of 
  333.     a collection when it is doing a 'do:'.  This will change the size of the 
  334.     collection and therefore change the times the loop is executed.  Shan 
  335.     August 12, 1989"
  336.  
  337.     links do: 
  338.         [:each | 
  339.         each isShown ifTrue: [each eraseLink].
  340.         (each theOtherEndOf: self)
  341.             removeLink: each.
  342.         each removeMode].
  343.     links _ nil.
  344.     mode isVisible ifTrue: [mode erase].
  345.     mode removeFromSuperMode.
  346.     mode release!
  347.  
  348. createNewMsgSelector
  349.     "Shan August 10, 1989"
  350.  
  351.     | newSelector aText newBlank fillInView savedArea |
  352.     newBlank _ FillInTheBlank new initialize.
  353.     newBlank action: [:answer | aText _ answer].
  354.     newBlank contents: clientObj class sourceCodeTemplate.
  355.     fillInView _ SpecialFTBlankView
  356.                 on: newBlank
  357.                 message: '    ***Please define the new message selector***       \         Use the middle button Menu to accept.\      Accepting an empty text aborts the dialogue.' withCRs
  358.                 displayAt: Sensor cursorPoint
  359.                 centered: true
  360.                 useCRController: false.
  361.     savedArea _ Form fromDisplay: fillInView displayBox.
  362.     self eventQueue disable.
  363.     fillInView display.
  364.     fillInView controller centerCursorInView.
  365.     fillInView controller startUp.
  366.     fillInView release.
  367.     self eventQueue enable.
  368.     savedArea displayOn: Display at: fillInView viewport topLeft.
  369.     aText = '' ifTrue: [^nil].
  370.     newSelector _ clientObj class
  371.                 compile: aText
  372.                 classified: 'temp'
  373.                 notifying: nil.
  374.     "Return the selector"
  375.     ^newSelector!
  376.  
  377. removeLink: aLink
  378.     "Shan August 12, 1989"
  379.  
  380.     links remove: aLink!
  381.  
  382. replace: oldObj with: newObj 
  383.     "Shan August 14, 1989"
  384.  
  385.     | index |
  386.     index _ oldObj class instSize.
  387.     [index > 0]
  388.         whileTrue: 
  389.             [newObj instVarAt: index put: (oldObj instVarAt: index).
  390.             index _ index - 1].
  391.     newObj become: oldObj!
  392.  
  393. subclassNewMsg
  394.     "Create a subclass and place the new message there.  
  395.     Shan August 14, 1989"
  396.  
  397.     self makeSubclass.
  398.     self createNewMsgSelector! !
  399.  
  400. !ObjectDelegate methodsFor: 'access'!
  401.  
  402. clientObject
  403.     "Shan August 13, 1989"
  404.  
  405.     ^clientObj!
  406.  
  407. clientObject: anObj
  408.     "Shan August 13, 1989"
  409.  
  410.     clientObj _ anObj.
  411.     self format!
  412.  
  413. theDelegate
  414.     "Shan August 21, 1989"
  415.     ^self! !
  416. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  417.  
  418. ObjectDelegate class
  419.     instanceVariableNames: ''!
  420.  
  421.  
  422. !ObjectDelegate class methodsFor: 'instance creation'!
  423.  
  424. clientObject: anObj 
  425.     "Shan August 13, 1989"
  426.  
  427.     ^self new clientObject: anObj! !
  428.  
  429. ObjectDelegate subclass: #SemObjDelegate
  430.     instanceVariableNames: ''
  431.     classVariableNames: 'SemObjDelegateMiddleButtonMenu '
  432.     poolDictionaries: ''
  433.     category: 'ModeEdit-Shan'!
  434.  
  435.  
  436. !SemObjDelegate methodsFor: 'display management'!
  437.  
  438. show
  439.     "Show self and the semDelLink.  Shan August 12, 1989"
  440.  
  441.     | semLink |
  442.     mode mapAndDisplay.
  443.     semLink _ links detect: [:each | each isKindOf: SemDelLink].
  444.     semLink show! !
  445.  
  446. !SemObjDelegate methodsFor: 'private'!
  447.  
  448. arrangePtr
  449.     "A semObj is assumed to have one pointer (target1) to other objects.  
  450.       Should the user want more, he needs to create a subclass of the   
  451.     current semObj to add the inst var's that keep the pointers.  Use   
  452.     'become:' to swap the replaced semObj.  Shan August 13, 1989"
  453.  
  454.     | choice index |
  455.     index _ clientObj class allInstVarNames indexOf: 'target1'.
  456.     clientObj target1 isNil
  457.         ifTrue: [^index]
  458.         ifFalse: 
  459.             [self eventQueue disable.
  460.             choice _ BinaryChoice message: 'The inst var "target1" has content.  Override?'.
  461.             self eventQueue enable.
  462.             choice
  463.                 ifTrue: 
  464.                     ["Erase whatever is necessary"
  465.                     self removePointerTo: (clientObj instVarAt: index).
  466.                     ^index]
  467.                 ifFalse: 
  468.                     [self eventQueue disable.
  469.                     choice _ BinaryChoice message: 'Create a new class to add the inst var?'.
  470.                     self eventQueue enable.
  471.                     choice
  472.                         ifTrue: [self makeSubclass]
  473.                         ifFalse: [^super arrangePtr]]]!
  474.  
  475. format
  476.     "Shan August 17, 1989"
  477.  
  478.     | name labelMode pictureMode |
  479.     name _ 'a' , clientObj class name asString.
  480.     mode subModes isEmpty
  481.         ifTrue: 
  482.             ["First time.  Create the subModes"
  483.             labelMode _ (TextLabel text: name) mode.
  484.             pictureMode _ (SemObjDelPicture semDelegate: self) mode]
  485.         ifFalse: 
  486.             [labelMode _ mode firstSubMode.
  487.             labelMode semanticObject text: name.
  488.             pictureMode _ mode lastSubMode].
  489.     ModeGrouper parent: mode centerVerticalChildren: (OrderedCollection with: labelMode with: pictureMode)! !
  490.  
  491. !SemObjDelegate methodsFor: 'MMS-initializations'!
  492.  
  493. setUpAppearance
  494.     "Override the effect of the setUpAppearance in the superClass.  Shan 
  495.     August 17, 1989"
  496.  
  497.     ^self! !
  498.  
  499. !SemObjDelegate methodsFor: 'middleMenu support'!
  500.  
  501. showConnection
  502.     "Show all links connected to self.  Also show target1 even if there is   
  503.     no link.  I go into alll these trouble because the copying mechanism 
  504.     does not copy the links and delegates.  A semObjDel must be able to 
  505.     create those at run time for the user to trace the connection.  Shan 
  506.     September 12, 1989"
  507.  
  508.     | del link cTarget1 semLink |
  509.     cTarget1 _ clientObj target1.
  510.     cTarget1 isNil ifTrue: ["No special treatment"
  511.         ^super showConnection].
  512.     "Check whether the link to target1 exists."
  513.     links detect: [:each | (each theOtherEndOf: self) clientObject == cTarget1]
  514.         ifNone: 
  515.             ["Check whether there is a delegate for cTarget1 already."
  516.             (cTarget1 isKindOf: SemanticObject)
  517.                 ifTrue: [del _ SemObjDelegate allInstances detect: [:eachDel | eachDel clientObject == cTarget1]
  518.                                 ifNone: 
  519.                                     ["Create the delegate for cTarget1."
  520.                                     del _ cTarget1 delegate.
  521.                                     del attachModeTo: mode topMode absAt: mode displayBox origin + (50 @ 150).
  522.                                     semLink _ SemDelLink semDel: del client: del clientObject.
  523.                                     semLink attachModeTo: mode topMode. semLink show.
  524.                                     del]]
  525.                 ifFalse: [del _ ObjectDelegate allInstances detect: [:eachDel | eachDel clientObject == cTarget1]
  526.                                 ifNone: 
  527.                                     ["Create the delegate for cTarget1."
  528.                                     del _ ObjectDelegate clientObject: cTarget1.
  529.                                     del attachModeTo: mode topMode absAt: mode displayBox origin + (50 @ 150).
  530.                                     del]].
  531.             "Establish the link"
  532.             link _ MessageLink between: self and: del.
  533.             mode topMode addToBackSubMode: link mode].
  534.     super showConnection! !
  535.  
  536. ResizeBackground subclass: #ModeEditBackground
  537.     instanceVariableNames: ''
  538.     classVariableNames: ''
  539.     poolDictionaries: ''
  540.     category: 'ModeEdit-Shan'!
  541. ModeEditBackground comment:
  542. 'ResizeBackground is a general class that can be used else where.  The stuffs specific to the Ctrl-E/ModeEdit are placed here.  Do not remove this class before check the references to it.  Shan November 18, 1989'!
  543.  
  544.  
  545. NetLink subclass: #SemDelLink
  546.     instanceVariableNames: ''
  547.     classVariableNames: ''
  548.     poolDictionaries: ''
  549.     category: 'ModeEdit-Shan'!
  550.  
  551.  
  552. !SemDelLink methodsFor: 'private'!
  553.  
  554. computeLinkPosition
  555.     "Here some transformation is needed because eventhough the Link 
  556.     always reside in the rootMode and the client mode may be a  
  557.     subMode of other mode.  If the viewport is used, it will be relative to 
  558.     the window of the superMode which is not right.  Shan August 8,  
  559.     1989"
  560.  
  561.     | center |
  562.     center _ to mode displayBox center.
  563.     center _ from mode superMode inverseDisplayTransform: center.
  564.     mode
  565.         from: from mode viewport center
  566.         to: center
  567.         width: 1
  568.         color: Form black!
  569.  
  570. semDel: d client: c 
  571.     "Assuming that the pointer is from semDel to the client.  Shan August 
  572.     8, 1989"
  573.  
  574.     from _ d.
  575.     to _ c.
  576.     self computeLinkPosition.
  577.     d addLink: self! !
  578.  
  579. !SemDelLink methodsFor: 'display management'!
  580.  
  581. updateLinkPosition
  582.     "Shan July 23, 1989"
  583.  
  584.     self computeLinkPosition.
  585.     mode map! !
  586. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  587.  
  588. SemDelLink class
  589.     instanceVariableNames: ''!
  590.  
  591.  
  592. !SemDelLink class methodsFor: 'instance creation'!
  593.  
  594. semDel: d client: c 
  595.     "Shan August 10, 1989"
  596.  
  597.     ^self new semDel: d client: c! !
  598.  
  599. NetLink subclass: #MessageLink
  600.     instanceVariableNames: 'fromArrow toArrow '
  601.     classVariableNames: ''
  602.     poolDictionaries: ''
  603.     category: 'ModeEdit-Shan'!
  604. MessageLink comment:
  605. 'This link can be bidirectional.  Shan August 10, 1989'!
  606.  
  607.  
  608. !MessageLink methodsFor: 'private'!
  609.  
  610. between: del1 and: del2 
  611.     "Set up the arrows for both directions but show only one.  Shan   
  612.     August 21, 1989"
  613.  
  614.     | lineM |
  615.     from _ del1.
  616.     to _ del2.
  617.     from addLink: self.
  618.     to addLink: self.
  619.     lineM _ LineMode new.
  620.     toArrow _ LinkArrow directionRadian: 0.
  621.     toArrow linkData: Set new.
  622.     toArrow arrowTarget: del2.
  623.     fromArrow _ LinkArrow directionRadian: 0.
  624.     fromArrow linkData: Set new.
  625.     fromArrow arrowTarget: del1.
  626.     fromArrow mode unMap.
  627.     mode addSubMode: lineM.
  628.     toArrow attachModeTo: mode.
  629.     fromArrow attachModeTo: mode.
  630.     self format!
  631.  
  632. format
  633.     "Take care of the arrows.  Shan  August 21, 1989"
  634.  
  635.     | ct cf temp1 v1 p1 p2 origin corner rect |
  636.     ct _ to mode viewport center.
  637.     cf _ from mode viewport center.
  638.     origin _ cf min: ct.
  639.     corner _ cf max: ct.
  640.     rect _ origin corner: corner + 2 asPoint.
  641.     mode window: (0 @ 0 extent: rect extent)
  642.         viewport: rect.
  643.     mode firstSubMode
  644.         from: cf - origin
  645.         to: ct - origin
  646.         width: 2
  647.         color: Form black.
  648.     temp1 _ ct - cf.
  649.     toArrow directionVector: temp1.  "Shan March 30, 1990"
  650.     fromArrow directionVector: temp1 * -1.
  651.     "v1 is the offset from the arrow centers to window center."
  652.     v1 _ (temp1 unitVector * 10) rounded.
  653.     p1 _ mode window center + v1 - (8 @ 8).
  654.     p2 _ mode window center - v1 - (8 @ 8).
  655.     toArrow mode moveRelativeTo: p1.
  656.     fromArrow mode moveRelativeTo: p2.
  657.     "Prevent the arrows from being clipped when the line is vertical or 
  658.     horizontal.  Shan August 23, 1989"
  659.     temp1 x abs < 12 ifTrue: [mode window: (mode window expandBy: 5 @ 0)
  660.             viewport: (mode viewport expandBy: 5 @ 0)].
  661.     temp1 y abs < 12 ifTrue: [mode window: (mode window expandBy: 0 @ 5)
  662.             viewport: (mode viewport expandBy: 0 @ 5)]! !
  663.  
  664. !MessageLink methodsFor: 'MMS-initializations'!
  665.  
  666. defaultModeClass
  667.     "Shan August 24, 1989"
  668.  
  669.     ^ModeGroup! !
  670.  
  671. !MessageLink methodsFor: 'display management'!
  672.  
  673. becomeBidirectional
  674.     "Show both arrows.  Shan September 14, 1989"
  675.  
  676.     fromArrow mode mapAndDisplay.
  677.     toArrow mode mapAndDisplay!
  678.  
  679. updateLinkPosition
  680.     "Shan August 21, 1989"
  681.  
  682.     self format! !
  683.  
  684. !MessageLink methodsFor: 'connection support'!
  685.  
  686. removeLinkTo: aSemObj 
  687.     "This is to support the LinkArrow to remove references.  Shan August 
  688.     23, 1989"
  689.  
  690.     | fromObj index |
  691.     fromObj _ (self theOtherEndOf: aSemObj) clientObject.
  692.     index _ fromObj class instSize.
  693.     [index > 0]
  694.         whileTrue: 
  695.             [(fromObj instVarAt: index)
  696.                 == aSemObj clientObject ifTrue: [fromObj instVarAt: index put: nil].
  697.             index _ index - 1].
  698.     "Erase the arrow.  Shan September 14, 1989"
  699.     fromArrow arrowTarget == aSemObj ifTrue: [fromArrow mode eraseAndUnMap] ifFalse: [toArrow mode eraseAndUnMap].
  700.     "Check to see if the link needs to be erased. (When both arrows are 
  701.     gone) "
  702.     fromArrow mode isVisible | toArrow mode isVisible
  703.         ifFalse: 
  704.             [from removeLink: self.
  705.             to removeLink: self.
  706.             self eraseLink.
  707.             mode removeFromSuperMode.
  708.             mode release]! !
  709. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  710.  
  711. MessageLink class
  712.     instanceVariableNames: ''!
  713.  
  714.  
  715. !MessageLink class methodsFor: 'instance creation'!
  716.  
  717. between: del1 and: del2 
  718.     "Since a link is bi-directional, doesn't matter which instance var. 
  719.     (from or to) store what as long as we keep the direction straight.  
  720.     Shan August 21, 1989"
  721.     "IMPORTANT!!  Only connect ObjectDelegates."
  722.  
  723.     ^self new between: del1 and: del2! !
  724.  
  725. SemanticObject subclass: #SemObjDelPicture
  726.     instanceVariableNames: 'theDelegate '
  727.     classVariableNames: ''
  728.     poolDictionaries: ''
  729.     category: 'ModeEdit-Shan'!
  730.  
  731.  
  732. !SemObjDelPicture methodsFor: 'MMS-initializations'!
  733.  
  734. defaultMMSControllerClass
  735.     "Shan August 25, 1989"
  736.  
  737.     ^MController!
  738.  
  739. defaultModeClass
  740.     "Shan August 17, 1989"
  741.  
  742.     ^FixedImageMode!
  743.  
  744. setUpAppearance
  745.     "Shan August 17, 1989"
  746.  
  747.     mode displayObject absAdd: MMSOpaqueForm semanticShape.
  748.     mode resizeToFitDisplayObject! !
  749.  
  750. !SemObjDelPicture methodsFor: 'access'!
  751.  
  752. semDelegate: aDel
  753.     theDelegate _ aDel!
  754.  
  755. theDelegate
  756.     "Shan August 21, 1989"
  757.  
  758.     ^theDelegate! !
  759. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  760.  
  761. SemObjDelPicture class
  762.     instanceVariableNames: ''!
  763.  
  764.  
  765. !SemObjDelPicture class methodsFor: 'instance creation'!
  766.  
  767. semDelegate: aDel 
  768.     "Shan August 17, 1989"
  769.  
  770.     ^self new semDelegate: aDel! !
  771.  
  772. SemanticObject subclass: #LinkArrow
  773.     instanceVariableNames: 'linkData arrowTarget '
  774.     classVariableNames: 'LinkArrowMiddleButtonMenu '
  775.     poolDictionaries: ''
  776.     category: 'ModeEdit-Shan'!
  777.  
  778.  
  779. !LinkArrow methodsFor: 'access'!
  780.  
  781. arrowTarget
  782.     "Try to be general here.  Shan August 21, 1989"
  783.  
  784.     ^arrowTarget!
  785.  
  786. arrowTarget: anObj 
  787.     "Try to be general here.  anObj could be anything.  Shan 
  788.     August 22, 1989"
  789.  
  790.     arrowTarget _ anObj!
  791.  
  792. linkData
  793.     "Try to be general here.  Shan August 21, 1989"
  794.  
  795.     ^linkData!
  796.  
  797. linkData: anObj 
  798.     "Try to be general here.  anObj could be a collection or a set.  Shan 
  799.     August 21, 1989"
  800.  
  801.     linkData _ anObj! !
  802.  
  803. !LinkArrow methodsFor: 'direction'!
  804.  
  805. directionRadian: aFloat
  806.     "Shan August 21, 1989"
  807.  
  808.     mode displayObject clear.
  809.     mode displayObject relAdd: (MMSOpaqueForm arrows closestAt: aFloat).
  810.     mode resizeToFitDisplayObject!
  811.  
  812. directionVector: aVect
  813.     "Shan March 30, 1990"
  814.  
  815.     mode displayObject clear.
  816.     mode displayObject relAdd: (MMSOpaqueForm arrows closestAtVector: aVect).
  817.     mode resizeToFitDisplayObject! !
  818.  
  819. !LinkArrow methodsFor: 'MMS-initializaionts'!
  820.  
  821. defaultMMSControllerClass
  822.     "Shan August 22, 1989"
  823.  
  824.     ^MidMenuController!
  825.  
  826. defaultModeClass
  827.     "Shan August 20, 1989"
  828.  
  829.     ^FixedImageMode! !
  830.  
  831. !LinkArrow methodsFor: 'middleMenu support'!
  832.  
  833. addMessage
  834.     "Arrange a message to an object.  Shan August 22, 1989"
  835.  
  836.     | msgSelector |
  837.     msgSelector _ arrowTarget arrangeMessage.
  838.     msgSelector isNil ifTrue: [^self].
  839.     linkData add: msgSelector!
  840.  
  841. messageImplementations
  842.     "Shan August 22, 1989"
  843.  
  844.     | selectors chosenSel browser chosenIndex |
  845.     linkData isEmpty ifTrue: [^self notify: 'No message exists yet.'].
  846.     selectors _ linkData asOrderedCollection.
  847.     self eventQueue disable.
  848.     chosenIndex _ (PopUpMenu labelList: (Array with: selectors)) startUp.
  849.     self eventQueue enable.
  850.     chosenIndex = 0 ifTrue: [^self].
  851.     chosenSel _ selectors at: chosenIndex.
  852.     "Open an editor for the selected selector."
  853.     browser _ arrowTarget privateGetABrowser copy.
  854.     browser onClass: arrowTarget clientObject class.
  855.     browser newProtocolList: (arrowTarget clientObject class whichCategoryIncludesSelector: chosenSel).
  856.     browser selector: chosenSel.
  857.     BrowserView openCategoryBrowserOn: browser browseHierarchy!
  858.  
  859. removeLink
  860.     "Shan August 23, 1989"
  861.  
  862.     "mode eraseAndUnMap. Moved to the MessageLink classs.  
  863.     Shan September 14, 1989"
  864.     mode superMode semanticObject removeLinkTo: arrowTarget!
  865.  
  866. removeMessage
  867.     "Remove a message to an object.  Shan August 22, 1989"
  868.  
  869.     | selectors chosenSel chosenIndex |
  870.     linkData isEmpty ifTrue: [^self notify: 'No message exists yet.'].
  871.     selectors _ linkData asOrderedCollection.
  872.     self eventQueue disable.
  873.     chosenIndex _ (PopUpMenu labelList: (Array with: selectors)) startUp.
  874.     self eventQueue enable.
  875.     chosenIndex = 0 ifTrue: [^self].
  876.     chosenSel _ selectors at: chosenIndex.
  877.     linkData remove: chosenSel! !
  878.  
  879. !LinkArrow methodsFor: 'menu access'!
  880.  
  881. middleButtonMenu
  882.     "Shan August 22, 1989"
  883.  
  884.     | logicMenu |
  885.     LinkArrowMiddleButtonMenu isNil
  886.         ifTrue: 
  887.             [logicMenu _ MMSMenu new.
  888.             logicMenu append: (MenuCell selector: #addMessage text: 'Add Message').
  889.             logicMenu append: (MenuCell selector: #removeMessage text: 'Remove Message').
  890.             logicMenu append: (MenuCell selector: #messageImplementations text: 'Implementations').
  891.             logicMenu append: (MenuCell selector: #removeLink text: 'Remove Link').
  892.             LinkArrowMiddleButtonMenu _ MMSPopUpMenu createInterfaceFor: logicMenu].
  893.     ^LinkArrowMiddleButtonMenu! !
  894. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  895.  
  896. LinkArrow class
  897.     instanceVariableNames: ''!
  898.  
  899.  
  900. !LinkArrow class methodsFor: 'instance creation'!
  901.  
  902. directionRadian: aFloat 
  903.     "Shan August 21, 1989"
  904.  
  905.     ^self new directionRadian: aFloat! !
  906.  
  907. ResizeProxy subclass: #ModeEditProxy
  908.     instanceVariableNames: 'borderOrInside '
  909.     classVariableNames: 'ModeEditProxyMiddleButtonMenu '
  910.     poolDictionaries: ''
  911.     category: 'ModeEdit-Shan'!
  912.  
  913.  
  914. !ModeEditProxy methodsFor: 'borderWidthEdit support'!
  915.  
  916. four
  917.     "Shan July 31, 1989"
  918.  
  919.     clientMode borderWidth: 4.
  920.     self displayClientMode!
  921.  
  922. one
  923.     "Shan July 31, 1989"
  924.  
  925.     clientMode borderWidth: 1.
  926.     self displayClientMode!
  927.  
  928. three
  929.     "Shan July 31, 1989"
  930.  
  931.     clientMode borderWidth: 3.
  932.     self displayClientMode!
  933.  
  934. two
  935.     "Shan July 31, 1989"
  936.  
  937.     clientMode borderWidth: 2.
  938.     self displayClientMode!
  939.  
  940. zero
  941.     "Shan July 31, 1989"
  942.  
  943.     clientMode borderWidth: 0.
  944.     self displayClientMode! !
  945.  
  946. !ModeEditProxy methodsFor: 'colorEdit support'!
  947.  
  948. black
  949.     "Shan July 31, 1989"
  950.  
  951.     clientMode perform: borderOrInside with: Form black!
  952.  
  953. darkGray
  954.     "Shan July 31, 1989"
  955.  
  956.     clientMode perform: borderOrInside with: Form darkGray!
  957.  
  958. gray
  959.     "Shan July 31, 1989"
  960.  
  961.     clientMode perform: borderOrInside with: Form gray!
  962.  
  963. lightGray
  964.     "Shan July 31, 1989"
  965.  
  966.     clientMode perform: borderOrInside with: Form lightGray!
  967.  
  968. transparent
  969.     "Shan July 31, 1989"
  970.  
  971.     borderOrInside = #borderColor: ifTrue: ["The borderColor should not be set nil.  No opp.  Should give a notifier here."
  972.         ^self].
  973.     clientMode perform: borderOrInside with: nil!
  974.  
  975. veryDarkGray
  976.     "Shan July 31, 1989"
  977.  
  978.     clientMode perform: borderOrInside with: Form veryDarkGray!
  979.  
  980. veryLightGray
  981.     "Shan July 31, 1989"
  982.  
  983.     clientMode perform: borderOrInside with: Form veryLightGray!
  984.  
  985. white
  986.     "Change the insideColor or borderColor of the clientMode to white.  
  987.     Shan July 31, 1989"
  988.  
  989.     clientMode perform: borderOrInside with: Form white! !
  990.  
  991. !ModeEditProxy methodsFor: 'middleMenu support'!
  992.  
  993. editAttributes
  994.     "This is for the IT creator to add his own editor to the interaction 
  995.     technique.  The control is passed on to the semantic object of the 
  996.     mode where the creator can code his special purpose editor for the 
  997.     IT.  Shan August 25, 1989"
  998.  
  999.     clientMode semanticObject editAttributes.
  1000.     self displayClientMode!
  1001.  
  1002. editController
  1003.     "Use a Smalltalk dictionary editor to edit the event response 
  1004.     dictionary of the controller.  Shan July 31, 1989"
  1005.  
  1006.     | erd |
  1007.     erd _ clientMode controller eventResponses deepCopy.
  1008.     "Have to make a copy.  Otherwise the change may affect the all 
  1009.     instances of the controller class.  This may be desirable but should 
  1010.     be thought out before providing it.  Shan July 31, 1989"
  1011.     clientMode controller eventResponses: erd.
  1012.     self eventQueue disable.
  1013.     erd inspect!
  1014.  
  1015. inspectClientMode
  1016.     "Use the Smallatlk MVC inspector to inspect the Mode structure.  
  1017.     Here the selector 'inspect' is avoided to enable the Smalltalk 
  1018.     debugger to inspect the ModeEditProxy is self.  Shan August 12, 
  1019.     1989 "
  1020.  
  1021.     self eventQueue disable. "Shan August 27, 1989"
  1022.     clientMode inspect!
  1023.  
  1024. remove
  1025.     "Removes the mode and all its connections.  Shan August 12, 1989"
  1026.  
  1027.     clientMode semanticObject clearAllConnections.
  1028.     clientMode removeFromSuperMode.
  1029.     self backToNormalState. "Shan 20 July 1990"
  1030.     clientMode release.!
  1031.  
  1032. showSemObj
  1033.     "Display the mode that represents the semObj, and then quit the   
  1034.     Ctrl-E state.  Shan August 6, 1989"
  1035.  
  1036.     | rootMode dMode newPos link semDelegate |
  1037.     clientMode semanticObject isNil ifTrue: [^self notify: 'This is a dummy mode.  No semantic object associated with it.'].
  1038.     semDelegate _ clientMode semanticObject delegate.
  1039.     "Input for a place to put the delegate."
  1040.     rootMode _ mode topMode.
  1041.     dMode _ semDelegate mode.
  1042.     dMode superMode isNil
  1043.         ifTrue: 
  1044.             ["First time"
  1045.             semDelegate attachModeTo: rootMode absAt: mode displayBox corner + (5 @ 5).
  1046.             dMode display.
  1047.             self eventQueue cursorPoint: dMode displayBox center.
  1048.             newPos _ dMode controller moveImageFBWithin: nil linkTo: (OrderedCollection with: mode displayBox center).
  1049.             newPos notNil ifTrue: [dMode moveTo: newPos].
  1050.             link _ SemDelLink semDel: semDelegate client: clientMode semanticObject.
  1051.             mode topMode addSubMode: link mode].
  1052.     semDelegate show.
  1053.     "Get back to the normal state.  Not in Ctrl-E state anymore."
  1054.     self backToNormalState! !
  1055.  
  1056. !ModeEditProxy methodsFor: 'modeEdit support'!
  1057.  
  1058. editBorderColor
  1059.     "The editing of borderColor and insideColor uses the same color map   
  1060.     menu.  The inst var 'borderOrInside' is used to distinguish them.  Shan 
  1061.      July 31, 1989"
  1062.  
  1063.     borderOrInside _ #borderColor:.
  1064.     MenuTestWorkSpace colorMapMenu startUpOnSemanticObject: self.
  1065.     self displayClientMode!
  1066.  
  1067. editHighlightStyle
  1068.     "Shan July 31, 1989"!
  1069.  
  1070. editInsideColor
  1071.     "Shan July 31, 1989"
  1072.  
  1073.     borderOrInside _ #insideColor:.
  1074.     MenuTestWorkSpace colorMapMenu startUpOnSemanticObject: self.
  1075.     self displayClientMode!
  1076.  
  1077. editResizeConstraints
  1078.     "Shan July 31, 1989"
  1079.  
  1080.     clientMode resizeStyle isNil ifTrue: [clientMode resizeStyle: ResizeStyle new].
  1081.     self eventQueue disable. "Shan September 13, 1989"
  1082.     clientMode resizeStyle inspect! !
  1083.  
  1084. !ModeEditProxy methodsFor: 'MMS-initializations'!
  1085.  
  1086. defaultMMSControllerClass
  1087.     "Shan 29 May 1990"
  1088.  
  1089.     ^MidMenuController!
  1090.  
  1091. setUpController
  1092.     "Shan 30 May 1990"
  1093.  
  1094.     | ctrl erDict |
  1095.     super setUpController.
  1096.     ctrl _ mode controller.
  1097.     erDict _ ctrl eventResponses deepCopy.
  1098.     erDict at: #leftButtonDown put: #action:.
  1099.     ctrl eventResponses: erDict.
  1100.     mode controller: ctrl! !
  1101.  
  1102. !ModeEditProxy methodsFor: 'private'!
  1103.  
  1104. backToNormalState
  1105.     "Quit the Ctrl-E state.  Shan August 12, 1989"
  1106.  
  1107.     mode superMode semanticObject action: nil!
  1108.  
  1109. displayClientMode
  1110.     "Shan July 31, 1989"
  1111.  
  1112.     | clientVisibility |
  1113.     clientVisibility _ clientMode isVisible.
  1114.     clientMode setVisible: true.
  1115.     clientMode display.
  1116.     clientMode setVisible: clientVisibility! !
  1117.  
  1118. !ModeEditProxy methodsFor: 'menu access'!
  1119.  
  1120. middleButtonMenu
  1121.     "Shan July 31, 1989"
  1122.  
  1123.     | logicMenu subM mEditM |
  1124.     ModeEditProxyMiddleButtonMenu isNil
  1125.         ifTrue: 
  1126.             [logicMenu _ MMSMenu new.
  1127.             logicMenu append: (MenuCell selector: #showSemObj text: 'Show SemObj').
  1128.             logicMenu append: (MenuCell selector: #editAttributes text: 'Edit MS Attributes').
  1129.             logicMenu append: (mEditM _ MenuCell selector: #editMode text: 'Edit Appearance').
  1130.             mEditM append: (MenuCell selector: #editInsideColor text: 'Inside Color').
  1131.             mEditM append: (MenuCell selector: #editBorderColor text: 'Border Color').
  1132.             mEditM append: (subM _ MenuCell selector: nil text: 'Border Width').
  1133.             subM append: MenuTestWorkSpace lineWidthLogicMenu.
  1134.             mEditM append: (MenuCell selector: #editHighlightStyle text: 'Highlight Style').
  1135.             mEditM append: (MenuCell selector: #editResizeConstraints text: 'Resize Constraints').
  1136.             logicMenu append: (MenuCell selector: #editController text: 'Edit Controller').
  1137.             logicMenu append: (MenuCell selector: #inspectClientMode text: 'Inspect').
  1138.             logicMenu append: (MenuCell selector: #remove text: 'Remove').
  1139.             "Shan September 16, 1989"
  1140.             logicMenu append: (MenuCell selector: #backToNormalState text: 'Back to Normal').
  1141.             ModeEditProxyMiddleButtonMenu _ MMSPopUpMenu createInterfaceFor: logicMenu].
  1142.     ^ModeEditProxyMiddleButtonMenu! !
  1143.  
  1144. !ModeEditProxy methodsFor: 'controller-msg'!
  1145.  
  1146. action: e 
  1147.     "Allow the user to place the mode in anywhere around the mode       
  1148.     hierarchy.  Shan August 16, 1989"
  1149.  
  1150.     | pos containingMode cMode cSuperM |
  1151.     pos _ clientMode controller moveImageFB.
  1152.     pos notNil
  1153.         ifTrue: 
  1154.             [cSuperM _ clientMode superMode.
  1155.             containingMode _ mode topMode
  1156.                         firstModeAt: self eventQueue mousePoint
  1157.                         suchThat: [:theMode | (theMode isKindOf: LineMode) not]
  1158.                         cutOff: (OrderedCollection with: mode superMode with: clientMode).  "Shan September 18, 1989"
  1159.             (containingMode semanticObject isKindOf: LibrarySpace)
  1160.                 ifTrue: 
  1161.                     ["This is a promotion."
  1162.                     cMode _ clientMode.
  1163.                     "After return to normal state, clientMode will be niled."
  1164.                     self backToNormalState.
  1165.                     ^containingMode semanticObject promote: cMode semanticObject].
  1166.             containingMode == cSuperM
  1167.                 ifTrue: [clientMode moveTo: pos]
  1168.                 ifFalse: 
  1169.                     [containingMode addSubMode: clientMode absAt: pos.
  1170.                     "containingMode could be the rootMode.  Pasting the 
  1171.                     clientMode on it will make it the first subMode which 
  1172.                     messes up the first event receiver position of the 
  1173.                     ResizeBk mode."
  1174.                     mode superMode moveToFront].
  1175.             clientMode display].
  1176.     clientMode displayBox ~= mode displayBox ifTrue: [clientMode changed: #moveResized]! !
  1177.  
  1178. FillInTheBlankView subclass: #SpecialFTBlankView
  1179.     instanceVariableNames: ''
  1180.     classVariableNames: ''
  1181.     poolDictionaries: ''
  1182.     category: 'ModeEdit-Shan'!
  1183. SpecialFTBlankView comment:
  1184. 'The standard FillInTheBlankView hardwires the size of the view.  The is a temp fix to extend the size.  Wait for PP to supply a better one.  Shan August 11, 1989'!
  1185.  
  1186. "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
  1187.  
  1188. SpecialFTBlankView class
  1189.     instanceVariableNames: ''!
  1190.  
  1191.  
  1192. !SpecialFTBlankView class methodsFor: 'private'!
  1193.  
  1194. buildAnswerView: aFillInTheBlank frameWidth: widthInteger
  1195.     | answerView |
  1196.     answerView _ self new model: aFillInTheBlank.
  1197.     answerView window: (0@0 extent: widthInteger @ 300).
  1198.     answerView borderWidth: 2.
  1199.     ^answerView! !